﻿using System;
using System.Collections;
using System.Collections.Generic;
//using IBatisNet.DataAccess;
using Wsitech.Model;

namespace Wsitech.BLL
{
	/// <summary>
    /// 功能：     MediaOrgan业务逻辑实现
    /// 作者：     LI
    /// 日期：     5/16/2012
    /// </summary>
	public class MediaOrganBLL
	{
		private Wsitech.Persistence.Interface.IMediaOrganDao dao = null;
		
		private MediaOrganBLL()
        {
            dao = Wsitech.Persistence.Dao.MediaOrganSqlMapDao.Instance;
        }
		
		#region （懒汉）单例模式
		private static MediaOrganBLL instance = null;
		private static object syncRoot = new object();
		public static MediaOrganBLL Instance
        {
            get 
            {
                if (instance == null)
                {
                    lock (syncRoot)
                    {
                        if (instance == null)
                        {
                            instance = new MediaOrganBLL();
                        }
                    }
                }
                return instance;
            }
        }
		#endregion
		
		
		#region	基本功能 不能修改
		
		
		/// <summary>
		/// 根据主键得到明细
		/// </summary>
		/// <returns></returns>
		public MediaOrgan GetDetail(System.String organid)
		{
			try
            {
                return dao.GetDetail(organid);
            }
            catch
            {
                throw;
            }
		}
		
		
		/// <summary>
		/// 得到列表
		/// </summary>
		/// <returns></returns>
        public IList< MediaOrgan> GetList()
        {
            try
            {
                IList< MediaOrgan> list = dao.GetList();
                return list;
            }
            catch
            {
                throw;
            }
        }
		
		/// <summary>
		/// 通过不同参数得到列表
		/// </summary>
		/// <param name="TopCounts"></param>
		/// <returns></returns>
        private IList< MediaOrgan> GetListByParams(object TopCounts, MediaOrgan mediaorgan)
        {
            try
            {
				Hashtable ht = new Hashtable();
				ht.Add("TopCounts",TopCounts);
                IList< MediaOrgan> list = dao.GetListByParams(ht);
                return list;
            }
            catch
            {
                throw;
            }
        }
		
		
		
		/// <summary>
        /// 新建
        /// </summary>
        /// <param name="mediaorgan"></param>
        /// <returns></returns>
		public object Add(MediaOrgan mediaorgan)
		{
			try
            {
                return dao.Add(mediaorgan);
            }
            catch
            {
                throw;
            }
		}
		
		/// <summary>
        /// 修改
        /// </summary>
        /// <param name="mediaorgan"></param>
        /// <returns></returns>
		public int Update(MediaOrgan mediaorgan)
		{
			try
            {
                return dao.Update(mediaorgan);
            }
            catch
            {
                throw;
            }
		}

		/// <summary>
		/// 删除
		/// </summary>
		/// <param name="OrganId"></param>
		/// <returns></returns>
		public int Delete(System.String organid)
		{
			try
            {
                return dao.Delete(organid);
            }
            catch
            {
                throw;
            }
		}
		
		#endregion
		
		
		#region 扩展功能
		
		#endregion
	}
}
